package com.test.multithread.future;

import java.util.function.Predicate;

class PreDemo {
    private static void pre(Predicate<String> one, Predicate<String> two) {
        boolean b = one.and(two).test("Hello Java");
        System.out.println("字符串是否包含“H”和“J”？ --- " + b);
    }

    public static void main(String[] args) {
        pre(s -> s.contains("H"), s -> s.contains("J"));
    }
}
